package com.wrupple.vegetate.domain.exceptions;

import java.io.Serializable;

import com.google.gwt.user.client.rpc.IsSerializable;

public class CatalogException extends Exception implements Serializable, IsSerializable {

	private static final long serialVersionUID = 1585790322777335722L;
	public static final int UNKNOWN = 0;
	public static final int UNAUTHORIZED = 1;
	public static final int EVENT_HANDLERS_FAILED = 2;
	public static final int INSUFFICIENT_METADATA = 3;
	public static final int UNSERIALIZABLE = 4;
	public static final int MISSINGCLASS = 5;
	private int errorCode;
	
	public CatalogException() {
		super();
		errorCode = UNKNOWN;
	}
	
	public CatalogException(String message, Throwable e, int errorcode) {
		super(message, e);
		this.errorCode=errorcode;
	}

	public CatalogException(String string, int code) {
		super(string);
		this.errorCode=code;
	}

	public int getErrorCode() {
		return errorCode;
	}

}
